select trim(PURCHASE.EBELN) as EBELN,trim(PURCHASE.MATNR) as MATNR,trim(PURCHASE.ZZFDESC1) as ZZFDESC1,trim(PURCHASE.MENGE) as MENGE,trim(PURCHASE.NETPR) as NETPR,trim(PURCHASE.NETWR) as NETWR,trim(PURCHASE.RETPO) as RETPO,trim(PURCHASE.ZTEXT_I) as ZTEXT_I,
trim(PURCHASE.BEDAT) as BEDAT,trim(PURCHASE.EINDT) as EINDT,trim(to_char(to_date(PURCHASE.BEDAT,'yyyymmdd'),'yyyy-mm-dd')) as DHRQ,
trim(to_char(to_date(PURCHASE.EINDT,'yyyymmdd'),'yyyy-mm-dd')) as YHRQ
from PURCHASE
WHERE EBELN=?